package cc.ServiceImpl;

import cc.Dao.CategoryDao;
import cc.Entity.Category;
import cc.Service.CategoryService;
import cc.Utils.UUIDUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Auther: ${张智杰}
 * @Date: 2018/10/13 14:49
 * @Description:
 */
@Service
public class CategoryServiceImpl implements CategoryService {
    @Autowired
    CategoryDao categoryDao;

    // <!--添加类别-->
   public int addCategory(Category category){
       category.setCategoryId(UUIDUtil.getUUID32());
        if(category == null || category.equals("")){
            return 0;
        }else{
            return categoryDao.addCategory(category);
        }
   }
    public List<Category> getAllCategory(){

            return categoryDao.getAllCategory();
        }

}
